@extends('admin.layouts.admin')

@section('content')
	<h1>News</h1>
	<div class="panel panel-info">
	<div class="panel-heading">Liste des news</div>
		<div class="table-responsive">
			<table class="table table-striped table-hover">
				<tbody>
					@foreach($news as $new)
						<tr>
							<td>{{ $new->date }}</td>
							<td>{{ $new->title }}</td>
							<td>
								<a target="_blank" href="{{ URL::route('news', array('year' => strftime('%Y',strtotime($new->date)), 'month' => strftime('%m',strtotime($new->date)), 'day' => strftime('%d',strtotime($new->date)), 'permlink' => $new->permalien)) }}" class="btn btn-success">
									<span class="glyphicon glyphicon-eye-open"></span>
									Lire
								</a>
								<a href="{{ URL::route('admin-edit-news', $new->id) }}" class="btn btn-primary">
									<span class="glyphicon glyphicon-edit"></span>
									Editer
								</a>
								<a href="{{ URL::route('admin-delete-news', $new->id) }}" class="btn btn-danger">
									<span class="glyphicon glyphicon-remove"></span>
									Supprimer
								</a>
							</td>
						</tr>
					@endforeach
				</tbody>
			</table>
		</div>
	</div>
	{{ $news->links() }}
	<a href="{{ URL::route('admin-add-news') }}" class="btn btn-primary">
		<span class="glyphicon glyphicon-edit"></span>
		Ecrire une news
	</a>
@stop